package com.dc.designPattern._17_mediator.impl;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * Description: 抽象同事类
 * @author: gdc
 * @date: 2021/6/2
 * @version 1.0
 */
@Data
@AllArgsConstructor
public abstract class Colleague {

    /**
     * 中介
     */
    private Mediator mediator;

    /**
     * 同事名字
     */
    private String name;

    /**
     * 发送消息
     *
     * @param stateChange 状态改变
     */
    public void sendMessage(int stateChange) {
        mediator.getMessage(stateChange, name);
    }
}
